import threading

class ReceiveCMD(threading.Thread):
    #专门用于接收平台发送指令的类
    def __init__(self, mq, mac_address):
        super().__init__()
        #mq对象
        self.__mq = mq
        #mac地址：用来作为队列名称
        self.__mac_address = mac_address

    def run(self):
        #组装队列名字，格式为：agent_[mac_address去除：]
        queue_name = "agent_{}_queue".format(self.__mac_address.replace(':', ''))
        #获取队列
        self.__mq.consume_queue(queue_name)


